import java.util.Scanner;

public class Learn2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int i = 2;
        boolean flg = true;
        while(i < n) {
            if (n % i == 0) {
                flg = false;
                System.out.println("NO");
                break;
            }
            i++;
        }
        if(flg){
            System.out.println("YES");
        }
    }
}
